<style>
  #bookStore-minus {
    pminusing: 20px 25px 25px 0;
  }

  #bookStore-minus .layui-treeSelect .ztree li a, .ztree li span {
    margin: 0 0 2px 3px !important;
  }
</style>
<div class="layui-fluid" id="bookStore-minus">
  <form class="layui-form" action="" lay-filter="bookStore-minus-form">
    <input type="hidden" name="id" data-th-value="${bookStore.id}">
    <input type="hidden" name="flag" data-th-value="${bookStore.flag}">
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">图书名称：</label>
      <div class="layui-input-block">
        <input type="text" name="bookname" lay-verify="required"
               autocomplete="off" class="layui-input" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">出版社：</label>
      <div class="layui-input-block">
        <input type="text" name="pubid" minlength="1" maxlength="10" lay-verify="required"
               autocomplete="off" class="layui-input" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">价格：</label>
      <div class="layui-input-block">
        <input type="text" name="bookmoney" autocomplete="off" class="layui-input"
               lay-verify="required|number" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">图书类型：</label>
      <div class="layui-input-block">
        <input type="text" name="type" autocomplete="off" class="layui-input"
               lay-verify="required" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">报损类型：</label>
      <div class="layui-input-block">
        <select name="bookfrom">
          <option value=""></option>
          <option value="1">正常报损</option>
          <option value="3">意外报损</option>
        </select>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">负责人：</label>
      <div class="layui-input-block">
        <input type="text" name="principal" autocomplete="off" class="layui-input"
               lay-verify="required">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">报损数量：</label>
      <div class="layui-input-block">
        <input type="text" name="num" autocomplete="off" class="layui-input"
               lay-verify="required|number">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">报损详情：</label>
      <div class="layui-input-block">
        <input type="text" name="message" autocomplete="off" class="layui-input"
               lay-verify="required">
      </div>
    </div>
    <div class="layui-form-item febs-hide">
      <button class="layui-btn" lay-submit="" lay-filter="bookStore-minus-form-submit" id="submit"></button>
    </div>
  </form>
</div>

<script data-th-inline="javascript">
  layui.use(['febs', 'form', 'validate', 'laydate'], function () {
    var $ = layui.$,
        febs = layui.febs,
        layer = layui.layer,
        form = layui.form,
        bookStore = [[${bookStore}]],
        validate = layui.validate;

    form.verify(validate);
    form.render();
    initbookStoreValue();

    function initbookStoreValue() {
      debugger
      form.val("bookStore-minus-form", {
        "id": bookStore.id,
        "bookname": bookStore.bookname,
        "booktype": bookStore.booktype,
        "bookmoney": bookStore.bookmoney,
        "pubid": bookStore.pubid,
        "type": bookStore.type,
        "flag": bookStore.flag,
      });
    }

    form.on('submit(bookStore-minus-form-submit)', function (data) {
      febs.post(ctx + 'bookStore/minus', data.field, function () {
        layer.closeAll();
        febs.alert.success('书籍报损申请成功');
        $('#febs-bookStore').find('#query').click();
      });
      return false;
    });
  });
</script>